<!--#INCLUDE FILE="config.asp"-->
<%
if(session("CostabajaId") = "" and Session("CostabajaAccessLevel") <> 2 ) then
	Response.Redirect("default.asp?msg=invalid")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- DATE PICKER SCRIPT -->
<link type="text/css" href="../css/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>
<script>
	$(function() {
		$( "#arrival1" ).datepicker();
		$( "#departure1" ).datepicker();
		$( "#arrival2" ).datepicker();
		$( "#departure2" ).datepicker();
	});
	</script>
  <!-- END DATE PICKER SCRIPT -->

<script> 
  //$(document).ready(function(){
  //$('.dashboad_wrapper tr:nth-child(odd)').addClass('alternate');
//});
</script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
    $('#list_table tr:nth-child(2n+1)').addClass('alternate');
});
</script>

  

<title>Costa Baja Panel de Control :: Costa Baja</title>

</head>
<body>

<div id="main_wrapper">
    	<div class="main_wrapper_margin">
        
           <div class="admin_top_menu">
            <!--#INCLUDE FILE="costabaja_menu.asp"--> 
           	</div><!-- END admin_top_menu -->
             
			<h1>Costa Baja de Control</h1>
            <div class="clear"></div>
            
            <div class="costabaja_dashboard_left">
            
            <h2>Pendiente por Aprovacion</h2>
            <hr/>
            </div>
            
            <div class="costabaja_dashboard_right">
            <h2>Llegada Pendinte</h2>
            <hr/>
            </div>   
            
            <div class="clear"></div>
            
        <div id="costabaja_dashboard_wrapper">
        
        	<div class="costabaja_dashboard_left">
   
            <table id="list_table" width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr class="titles">
    <td>Huesped</td>
    <td>Fecha</td>
     <td>&nbsp;</td>
  </tr>  
  <%
sqlstring = ""
sqlstring = sqlstring & "select MIN(dbo.Guests.Surname) AS Surname, MIN(dbo.Guests.Name) AS Name, MIN(dbo.Guests.GuestID) AS GuestId, MIN(dbo.Guests.CreatedDate) AS DateAdded "
sqlstring = sqlstring & " from Guests_Travels "
sqlstring = sqlstring & " Inner join Guests on Guests_Travels.GuestID = Guests.GuestID "
sqlstring = sqlstring & " INNER JOIN Travels on Guests_Travels.TravelID = Travels.TravelID  "
sqlstring = sqlstring & " WHERE  Travels.StatusID = 2 Or Travels.StatusID = 4 "
sqlstring = sqlstring & " Group by dbo.Guests.GuestID "

set objConnect = server.createObject("ADODB.Connection")   

objConnect.Open conStr

set TblTemp = server.createobject("Adodb.Recordset")
		
		TblTemp.Open Sqlstring, objConnect
		
		Do Until TblTemp.EOF
			guestID = TblTemp("GuestID")
			re_Surname = TblTemp("Surname")
			re_Name = TblTemp("Name")
			re_Date = TblTemp("DateAdded")
%>
  <tr>
    <td><%=re_Surname%> <%=re_Name%></td>
    <td><%=FormatDateTime(re_Date,2)%></td>
    <td><a href="costabaja-pending-approval.asp?gId=<%=guestID%>">Ver Detalles</a></td>
  
<%
	TblTemp.MoveNext
	Loop

%>
</table>
            
            </div><!-- END .costabaja_dashboard_left -->
              
            <div class="costabaja_dashboard_right">
            
            <table id="list_table" width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr class="titles">
    <td>Huesped</td>
    <td>Fecha</td>
     <td>&nbsp;</td>
  </tr>   
  <%
sqlstring = ""
sqlstring = sqlstring & "select MIN(dbo.Guests.Surname) AS Surname, MIN(dbo.Guests.Name) AS Name, MIN(dbo.Guests.GuestID) AS GuestId,  MIN(dbo.Reservation.ActualArrival) AS dateArrival "
sqlstring = sqlstring & " from Guests_Travels "
sqlstring = sqlstring & " Inner join Guests on Guests_Travels.GuestID = Guests.GuestID "
sqlstring = sqlstring & " INNER JOIN Travels on Guests_Travels.TravelID = Travels.TravelID  "
sqlstring = sqlstring & " INNER JOIN Reservation on Reservation.TravelID = Travels.TravelID  "
sqlstring = sqlstring & " WHERE  Travels.StatusID = 5 "
sqlstring = sqlstring & " Group by dbo.Guests.GuestID "
sqlstring = sqlstring & " ORDER BY dateArrival "

set objConnect = server.createObject("ADODB.Connection")   

objConnect.Open conStr

set TblTemp = server.createobject("Adodb.Recordset")
		
		TblTemp.Open Sqlstring, objConnect
		
		Do Until TblTemp.EOF
			guestID = TblTemp("GuestID")
			re_Surname = TblTemp("Surname")
			re_Name = TblTemp("Name")
			re_ArrivalDate1 = TblTemp("dateArrival")
%>
  <tr>
    <td><%=re_Surname%> <%=re_Name%></td>
    <td><%=re_ArrivalDate1%></td>
    <td><a href="costabaja-pending-arrival.asp?gId=<%=guestID%>">Ver Detalles</a></td>
  
<%
	TblTemp.MoveNext
	Loop

%>
</table>
            
            </div><!-- END .costabaja_dashboard_right -->
            
            <div class="clear"></div><!-- .clear -->
        	
        </div><!-- END #costabaja_dashboard_wrapper  -->    
  
        
        
        
        
    	</div><!-- END .main_wrapper_margin -->
        
	</div><!-- END #main_wrapper -->

         <!-- FOOTER -->
         
         <!--#INCLUDE FILE="costabaja_footer.asp"-->
         
         <!-- END FOOTER -->   

</body>
</html>
